<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="org.apache.shiro.web.filter.authc.FormAuthenticationFilter"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>

	<head>
		<meta charset="utf-8">
		<title>投诉工单管理系统</title>
		<link href="${ctxStatic }/common/sjcx.css" rel="stylesheet" type="text/css">
		<script src="${ctxStatic }/jquery/jquery.placeholder.min.js"></script>
		<script type="text/javascript">
			$(document).ready(function() {
				$("#loginForm").validate({
					rules: {
						validateCode: {remote: "${pageContext.request.contextPath}/servlet/validateCodeServlet"}
					},
					messages: {
						username: {required: "请填写用户名."},password: {required: "请填写密码."},
						validateCode: {remote: "验证码不正确.", required: "请填写验证码."}
					},
					errorLabelContainer: "#messageBox",
					errorPlacement: function(error, element) {
						error.appendTo($("#loginError").parent());
					} 
				});
			});
			// 如果在框架或在对话框中，则弹出提示并跳转到首页
			if(self.frameElement && self.frameElement.tagName == "IFRAME" || $('#left').length > 0 || $('.jbox').length > 0){
				alert('未登录或登录超时。请重新登录，谢谢！');
				top.location = "${ctx}";
			}
			$(function() {
				$('input, textarea').placeholder();
			});
		</script>
	</head>

	<body>
		<div class="login_logo"></div>
		<div class="login_bg">
			<div class="login_content">
				<div class="login_left">
					<p class="login_left_01">投诉工单管理系统</p>
					<p class="login_left_02">Complaints Work Order Management System</p>
					<div class="login_left_03"></div>
				</div>
				<div class="login_right">
					<div class="login_right_01">
						<div class="login_right_03">Login</div>
						<form id="loginForm" class="form-signin" action="${ctx}/login" method="post">
							<label class="input-label" for="username">登录名</label>
							<input type="text" id="username" name="username" class="input-block-level required" value="${username}">
							<label class="input-label" for="password">密码</label>
							<input type="password" id="password" name="password" class="input-block-level required">
							<c:if test="${isValidateCodeLogin}"><div class="validateCode">
								<label class="input-label mid" for="validateCode">验证码</label>
								<sys:validateCode name="validateCode" inputCssStyle="margin-bottom:0;"/>
							</div></c:if>
							
							<%--
							<label for="mobile" title="手机登录"><input type="checkbox" id="mobileLogin" name="mobileLogin" ${mobileLogin ? 'checked' : ''}/></label> --%>
							<input class="btn btn-large btn-primary" type="submit" value="登 录"/>&nbsp;&nbsp;
							<label for="rememberMe" title="下次不需要再登录"><input type="checkbox" id="rememberMe" name="rememberMe" ${rememberMe ? 'checked' : ''}/> 记住我（公共场所慎用）</label>
							<div id="themeSwitch" class="dropdown">
								<a class="dropdown-toggle" data-toggle="dropdown" href="#">${fns:getDictLabel(cookie.theme.value,'theme','默认主题')}<b class="caret"></b></a>
								<ul class="dropdown-menu">
								  <c:forEach items="${fns:getDictList('theme')}" var="dict"><li><a href="#" onclick="location='${pageContext.request.contextPath}/theme/${dict.value}?url='+location.href">${dict.label}</a></li></c:forEach>
								</ul>
								<!--[if lte IE 6]><script type="text/javascript">$('#themeSwitch').hide();</script><![endif]-->
							</div>
						</form>
					</div>
				</div>
				<!-- <div class="login_right">
					<div class="login_right_01">
						<div class="login_right_03">Login</div>
						<div><input type="text" class="login_right_04" placeholder="用户名"></div>
						<div><input type="password" class="login_right_05" placeholder="密码"></div>
						<div>
							<input class="login_right_06" type="button" value="重置">
							<input class="login_right_07" type="submit" value="登录">
						</div>
					</div>
					<div class="login_right_02"></div>
				</div> -->
			</div>
		</div>
		<p class="login_footer">Copyright © 2017 Sichuan Aocheng Technology Co.,Ltd</p>
	</body>

</html>